package rok3.zesp.projekt.models.abstracts;

import rok3.zesp.projekt.Settings;
import rok3.zesp.projekt.models.ColdDownBar;
import rok3.zesp.projekt.models.InformationTip;
import rok3.zesp.projekt.models.interfaces.Resizable;
import rok3.zesp.projekt.models.interfaces.Usable;

import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Button;

public abstract class AbstractGadget extends Group implements Resizable, Usable {
	int cd;
	InformationTip informationTip;
	Button useButton;
	Button throwButton;
	ColdDownBar colddownBar;
	
	public AbstractGadget() {
		Settings.register(this);

		this.addActor(getUseButton());
		this.addActor(getThrowButton());
		this.addActor(getColdDownBar().getImage());
		this.addActor(getInformationTip());
	}

	@Override
	public void act(float delta) {
		colddownBar.update(delta);
		super.act(delta);
	}
	
	private ColdDownBar getColdDownBar() {
		if ( colddownBar == null ) {
			
		}
		return colddownBar;
	}

	abstract protected InformationTip getInformationTip();

	abstract protected Button getUseButton();

	abstract protected Button getThrowButton();

	@Override
	public void resize(float ratioX, float ratioY) {
		this.setScaleX(ratioX);
		this.setScaleY(ratioY);
	}
	
}
